package com.bytezero.login_test.BaseActivity;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import androidx.annotation.IdRes;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;

/**
 * @author Bytezero_zhenglei!
 * @package com.bytezero.login_test
 * @fileName
 * @data 2022/1/26 18:18
 * @description
 * @TODO
 * @email 420498246@qq.com
 */
public abstract class BaseFragment extends Fragment {
    protected View contentView;

    protected abstract int getLayoutId();

    protected abstract void initView();

    @Nullable
    @Override
    public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {

        contentView = inflater.inflate(getLayoutId(), container, false);
        initView();
        return contentView;
    }

    protected <T extends View> T find(@IdRes int id) {
        return contentView.findViewById(id);
    }
}
